#ifndef gamefont_h
#define gamefont_h
#include "Glyph.h"
#include <gl\glew.h>


namespace freetype
{
	enum class type{ ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT }; //strongly typed and strongly scoped - C++11
	struct vec2
	{
		float x;
		float y;
	};

	class Gamefont
	{
		
	public:
		Gamefont();
		~Gamefont();

		//Create the font with a specific height and weight
		void CreateFontFT(const char* strTypeface, GLuint program, int point_size, int dpi);
		void DrawTextFT(const char* strText, vec2 pos, vec2 scale, type alignement);
		void GiveScreenSize(int w, int h){ screen_w = w; screen_h = h; }

	private:
		GlyphData glyph;
		void GetGlyph(char c);
		void InitVboAndTexture();
		bool IntiliazeFont(const char* strTypeface, int point_size, int dpi){ return glyph.LoadGlyph(strTypeface, point_size, dpi); }
		
		int currentsize; // current size of text
		int screen_w; //screen_w
		int screen_h; //screen_h

		GLuint tex;   //For texture
		GLuint sampler; //Sampler
		GLuint vbo; //Vertex Buffer Object
		GLuint vao; //Vertex Array Object
		GLuint uniform_tex; //text uniform location
	};
}
#endif